export function getWXStatusHeight() {
	// 获取距上
	const barTop = wx.getSystemInfoSync().statusBarHeight
	// 获取胶囊按钮位置信息
	const menuButtonInfo = wx.getMenuButtonBoundingClientRect()
	// 获取导航栏高度
	const barHeight = menuButtonInfo.height + (menuButtonInfo.top - barTop) * 2
	let barWidth = menuButtonInfo.width


	return {
		barHeight,
		barTop,
		barWidth
	}

}

/**
 * 获取当前页面路径和参数
 */
export function getQueryFromUrl() {
	const pages = getCurrentPages();
	const currentPage = pages[pages.length - 1];
	const options = currentPage.options;
	console.log('小程序页面参数:', options);
	return options;
}

/**
 * vh => px
 */
export function getVhToPx() {
	const info = uni.getSystemInfoSync(); // 获取系统信息
	const vh = 50; // 假设你想转换的vh值
	const vhToPx = (vh / 100) * info.windowHeight; // 计算50vh对应的px值
	console.log(vhToPx); // 输出结果
	return vhToPx;
}